package com.cloudcross.ssp.model;

import java.util.Date;

public final class DeliverAnalysis {
    //id
    private Long id;
    //广告主id
    private Long advertiserId;
    //订单id
    private Long orderId;
    //投放id
    private Long adGroupId;
    //创意id
    private Long bannerId;
    //创意模板Id
    private Long bannerTemplateId;
    //场景id
    private Long placeId;
    //地域
    private String location;
    //系统
    private Integer os;
    //广告主名称
    private String advertiserName;
    //场景名称
    private String placeName;
    //订单名称
    private String orderName;
    //活动名称
    private String campaignName;
    //投放名称
    private String adGroupName;
    //创意分组名称
    private String bannerName;

    //请求数
    private double request;
    //曝光数
    private double impression;
    //曝光总数
    private double impressionSum;
    //点击数
    private double click;
    //点击总数
    private double clickSum;
    //到达数
    private double visit;
    //到达总数
    private double visitSum;
    //转化数
    private double conversion;
    //转化总数
    private double conversionSum;
    //曝光占比
    private double impressionRate;
    //点击率
    private double clickRate;
    //全部对应的点击率
    private double clickRatesum;
    //到达率
    private double visitRate;
    //全部对应的到达率
    private double visitRatesum;
    //转化率
    private double conversionRate;
    //全部对应的转化率
    private double conversionRatesum;
    //eCmp
    private double eCmp;
    //eCmp总数
    private double eCmpSum;
    //花费
    private double consume;
    //花费总额
    private double consumeSum;

    //开始时间
    private Date startDate;

    //结束时间
    private Date endDate;

    //日期
    private Date reportDate;

    //小时
    private Integer hour;

    //广告位id
    private Long zoneId;
    //广告位
    private String zoneName;
    //浏览量占比
    private double viewRate;

    //广告位宽
    private double width;
    //广告位高
    private double height;
    //位置
    private Long position;
    //系统
    private Long system;

    //类型
    private Long device;


    //省份
    private String cn;
    //是不是省份的标志1-表示省份，2-表示不是,默认不是
    //注：这个属性是在地域报表导出excel时用到的
    private Integer cnMark = 2;
    //城市
    private String cn_city;
    //场景
    private String place;

    //热点
    private String apmac;


    //PV
    private double pv;
    //UV
    private double uv;

    //唯一曝光数
    private Long uImpression;
    //唯一点击数
    private Long uClick;

    //填充率
    private double fillRate;


    //eCmp
    private double eCpm;
    //收入
    private double income;
    //日期

    private String operatorAgentName;


    public String getOperatorAgentName() {
        return operatorAgentName;
    }

    public void setOperatorAgentName(String operatorAgentName) {
        this.operatorAgentName = operatorAgentName;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getAdvertiserId() {
        return advertiserId;
    }

    public void setAdvertiserId(Long advertiserId) {
        this.advertiserId = advertiserId;
    }

    public Long getOrderId() {
        return orderId;
    }

    public void setOrderId(Long orderId) {
        this.orderId = orderId;
    }

    public Long getAdGroupId() {
        return adGroupId;
    }

    public void setAdGroupId(Long adGroupId) {
        this.adGroupId = adGroupId;
    }

    public Long getBannerId() {
        return bannerId;
    }

    public void setBannerId(Long bannerId) {
        this.bannerId = bannerId;
    }

    public Long getBannerTemplateId() {
        return bannerTemplateId;
    }

    public void setBannerTemplateId(Long bannerTemplateId) {
        this.bannerTemplateId = bannerTemplateId;
    }

    public Long getPlaceId() {
        return placeId;
    }

    public void setPlaceId(Long placeId) {
        this.placeId = placeId;
    }

    public String getLocation() {
        return location;
    }

    public void setLocation(String location) {
        this.location = location;
    }

    public Integer getOs() {
        return os;
    }

    public void setOs(Integer os) {
        this.os = os;
    }

    public String getAdvertiserName() {
        return advertiserName;
    }

    public void setAdvertiserName(String advertiserName) {
        this.advertiserName = advertiserName;
    }

    public String getPlaceName() {
        return placeName;
    }

    public void setPlaceName(String placeName) {
        this.placeName = placeName;
    }

    public String getOrderName() {
        return orderName;
    }

    public void setOrderName(String orderName) {
        this.orderName = orderName;
    }

    public String getCampaignName() {
        return campaignName;
    }

    public void setCampaignName(String campaignName) {
        this.campaignName = campaignName;
    }

    public String getAdGroupName() {
        return adGroupName;
    }

    public void setAdGroupName(String adGroupName) {
        this.adGroupName = adGroupName;
    }

    public String getBannerName() {
        return bannerName;
    }

    public void setBannerName(String bannerName) {
        this.bannerName = bannerName;
    }

    public double getRequest() {
        return request;
    }

    public void setRequest(double request) {
        this.request = request;
    }

    public double getImpression() {
        return impression;
    }

    public void setImpression(double impression) {
        this.impression = impression;
    }

    public double getImpressionSum() {
        return impressionSum;
    }

    public void setImpressionSum(double impressionSum) {
        this.impressionSum = impressionSum;
    }

    public double getClick() {
        return click;
    }

    public void setClick(double click) {
        this.click = click;
    }

    public double getClickSum() {
        return clickSum;
    }

    public void setClickSum(double clickSum) {
        this.clickSum = clickSum;
    }

    public double getVisit() {
        return visit;
    }

    public void setVisit(double visit) {
        this.visit = visit;
    }

    public double getVisitSum() {
        return visitSum;
    }

    public void setVisitSum(double visitSum) {
        this.visitSum = visitSum;
    }

    public double getConversion() {
        return conversion;
    }

    public void setConversion(double conversion) {
        this.conversion = conversion;
    }

    public double getConversionSum() {
        return conversionSum;
    }

    public void setConversionSum(double conversionSum) {
        this.conversionSum = conversionSum;
    }

    public double getImpressionRate() {
        return impressionRate;
    }

    public void setImpressionRate(double impressionRate) {
        this.impressionRate = impressionRate;
    }

    public double getClickRate() {
        return clickRate;
    }

    public void setClickRate(double clickRate) {
        this.clickRate = clickRate;
    }

    public double getClickRatesum() {
        return clickRatesum;
    }

    public void setClickRatesum(double clickRatesum) {
        this.clickRatesum = clickRatesum;
    }

    public double getVisitRate() {
        return visitRate;
    }

    public void setVisitRate(double visitRate) {
        this.visitRate = visitRate;
    }

    public double getVisitRatesum() {
        return visitRatesum;
    }

    public void setVisitRatesum(double visitRatesum) {
        this.visitRatesum = visitRatesum;
    }

    public double getConversionRate() {
        return conversionRate;
    }

    public void setConversionRate(double conversionRate) {
        this.conversionRate = conversionRate;
    }

    public double getConversionRatesum() {
        return conversionRatesum;
    }

    public void setConversionRatesum(double conversionRatesum) {
        this.conversionRatesum = conversionRatesum;
    }

    public double geteCmp() {
        return eCmp;
    }

    public void seteCmp(double eCmp) {
        this.eCmp = eCmp;
    }

    public double geteCmpSum() {
        return eCmpSum;
    }

    public void seteCmpSum(double eCmpSum) {
        this.eCmpSum = eCmpSum;
    }

    public double getConsume() {
        return consume;
    }

    public void setConsume(double consume) {
        this.consume = consume;
    }

    public double getConsumeSum() {
        return consumeSum;
    }

    public void setConsumeSum(double consumeSum) {
        this.consumeSum = consumeSum;
    }

    public Date getStartDate() {
        return startDate;
    }

    public void setStartDate(Date startDate) {
        this.startDate = startDate;
    }

    public Date getEndDate() {
        return endDate;
    }

    public void setEndDate(Date endDate) {
        this.endDate = endDate;
    }

    public Date getReportDate() {
        return reportDate;
    }

    public void setReportDate(Date reportDate) {
        this.reportDate = reportDate;
    }

    public Integer getHour() {
        return hour;
    }

    public void setHour(Integer hour) {
        this.hour = hour;
    }


    public Long getZoneId() {
        return zoneId;
    }

    public void setZoneId(Long zoneId) {
        this.zoneId = zoneId;
    }

    public String getZoneName() {
        return zoneName;
    }

    public void setZoneName(String zoneName) {
        this.zoneName = zoneName;
    }

    public double getViewRate() {
        return viewRate;
    }

    public void setViewRate(double viewRate) {
        this.viewRate = viewRate;
    }

    public double getWidth() {
        return width;
    }

    public void setWidth(double width) {
        this.width = width;
    }

    public double getHeight() {
        return height;
    }

    public void setHeight(double height) {
        this.height = height;
    }

    public Long getPosition() {
        return position;
    }

    public void setPosition(Long position) {
        this.position = position;
    }

    public Long getSystem() {
        return system;
    }

    public void setSystem(Long system) {
        this.system = system;
    }

    public Long getDevice() {
        return device;
    }

    public void setDevice(Long device) {
        this.device = device;
    }

    public String getCn() {
        return cn;
    }

    public void setCn(String cn) {
        this.cn = cn;
    }

    public Integer getCnMark() {
        return cnMark;
    }

    public void setCnMark(Integer cnMark) {
        this.cnMark = cnMark;
    }

    public String getCn_city() {
        return cn_city;
    }

    public void setCn_city(String cn_city) {
        this.cn_city = cn_city;
    }

    public String getPlace() {
        return place;
    }

    public void setPlace(String place) {
        this.place = place;
    }

    public String getApmac() {
        return apmac;
    }

    public void setApmac(String apmac) {
        this.apmac = apmac;
    }

    public double getPv() {
        return pv;
    }

    public void setPv(double pv) {
        this.pv = pv;
    }

    public double getUv() {
        return uv;
    }

    public void setUv(double uv) {
        this.uv = uv;
    }

    public Long getuImpression() {
        return uImpression;
    }

    public void setuImpression(Long uImpression) {
        this.uImpression = uImpression;
    }

    public Long getuClick() {
        return uClick;
    }

    public void setuClick(Long uClick) {
        this.uClick = uClick;
    }

    public double getFillRate() {
        return fillRate;
    }

    public void setFillRate(double fillRate) {
        this.fillRate = fillRate;
    }

    public double geteCpm() {
        return eCpm;
    }

    public void seteCpm(double eCpm) {
        this.eCpm = eCpm;
    }

    public double getIncome() {
        return income;
    }

    public void setIncome(double income) {
        this.income = income;
    }

    @Override
    public String toString() {
        return "DeliverAnalysis [id=" + id + ", advertiserId=" + advertiserId
                + ", orderId=" + orderId + ", campaignId="
                + ", adGroupId=" + adGroupId + ", bannerId=" + bannerId
                + ", bannerTemplateId=" + bannerTemplateId + ", placeId="
                + placeId + ", location=" + location + ", os=" + os
                + ", advertiserName=" + advertiserName + ", placeName="
                + placeName + ", orderName=" + orderName + ", campaignName="
                + campaignName + ", adGroupName=" + adGroupName
                + ", bannerName=" + bannerName + ", request=" + request
                + ", impression=" + impression + ", impressionSum="
                + impressionSum + ", click=" + click + ", clickSum=" + clickSum
                + ", visit=" + visit + ", visitSum=" + visitSum
                + ", conversion=" + conversion + ", conversionSum="
                + conversionSum + ", impressionRate=" + impressionRate
                + ", clickRate=" + clickRate + ", clickRatesum=" + clickRatesum
                + ", visitRate=" + visitRate + ", visitRatesum=" + visitRatesum
                + ", conversionRate=" + conversionRate + ", conversionRatesum="
                + conversionRatesum + ", eCmp=" + eCmp + ", eCmpSum=" + eCmpSum
                + ", consume=" + consume + ", consumeSum=" + consumeSum
                + ", startDate=" + startDate + ", endDate=" + endDate
                + ", reportDate=" + reportDate + ", hour=" + hour + ", zoneId="
                + zoneId + ", zoneName=" + zoneName + ", viewRate=" + viewRate
                + ", width=" + width + ", height=" + height + ", position="
                + position + ", system=" + system + ", device=" + device
                + ", cn=" + cn + ", cnMark=" + cnMark + ", cn_city=" + cn_city
                + ", place=" + place + ", apmac=" + apmac + ", pv=" + pv
                + ", uv=" + uv + ", uImpression=" + uImpression + ", uClick="
                + uClick + ", fillRate=" + fillRate + ", eCpm=" + eCpm
                + ", income=" + income + "]";
    }

    public double getFillRateView() {
        if (this.pv == 0) {
            return 0.00;
        } else {
            return 100.00 * this.impression / this.pv;
        }
    }

    public double getClickRateView() {
        if (this.impression == 0) {
            return 0.00;
        } else {
            return 100.00 * this.click / this.impression;
        }
    }
}
